package patterns.observer;

/**
 * Created by lenovo on 2016/12/1 0001.
 * 观察者实体类
 */
public class BinaryObserver extends Observer {
    public BinaryObserver(Subject subject) {
        this.subject = subject;
        this.subject.attach(this);
    }

    /**
     * 更新状态
     */
    @Override
    public void update() {
        System.out.println("Binary String  : " + Integer.toBinaryString(subject.getState()));
    }
}
